package structure.recursion;

public class Factorial {

    public static long factorial(int k){
        if(k==0||k==1){
            return k;
        }else{
            return k * factorial(k-1);
        }
    }

    public static void main(String[] args){
        for(int i=0;i<10;i++){
            System.out.println("阶层数:["+i+"],value:"+factorial(i));
        }
    }
}
